import React, { Component } from 'react'

export default class App extends Component {
    state={count:1}
  render() {
    return (
      <div>
          {this.state.count}
          <button onClick={this.handleClick}>add</button>
      </div>
    )
  }

  /* setState在同步里异步，在异步里同步 */
  handleClick=()=>{
      this.setState({count:this.state.count+1})
      this.setState({count:this.state.count+1})
      this.setState({count:this.state.count+1})
  }
}
